﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;

namespace Zero.Common
{
    /// <summary>
    /// Object for message-based comunication through WCF.
    /// For internal use only.
    /// </summary>
    [Serializable, KnownType("GetKnownTypes")]
    public class TransportObject
    {
        /// <summary>
        /// For internal use only.
        /// </summary>
        /// <param name="data"></param>
        public TransportObject(object data)
        {
            Data = data;
        }

        /// <summary>
        /// For internal use only.
        /// </summary>
        public object Data { get; private set; }

        /// <summary>
        /// For internal use only.
        /// </summary>
        /// <returns></returns>
        public static IEnumerable<Type> GetKnownTypes()
        {
            return TransportTypesLocator.GetTransportTypes();
        }        
    }
}
